clear all;
close all;
clc

%不同的计算机需要修改此处的地址以调用txt文件
data1=load('/Users/tingting/Desktop/p_E1.txt');
data2=load('/Users/tingting/Desktop/p_E2.txt');
d1=data1(:,1);
d2=data2(:,1);
figure;
hold on;
x1=0:0.01:28;%修改此处的值可改变绘制图像自变量的范围
n=7;
   y1=zeros(1,2801);%该处的值根据自变量的值进行变换
    for i=0:n-1
        for j=1:2801%此处亦然
        y1(j)=y1(j)+d1(i+1)*x1(j)^(n-1-i);
        end
    end
    l1=plot(x1,y1,'Linewidth',2);
    

x2=0:0.01:28;%同上
n=7;
   y2=zeros(1,2801);%同上
    for i=0:n-1
        for j=1:2801%同上
        y2(j)=y2(j)+d2(i+1)*x2(j)^(n-1-i);
        end
    end
    l2=plot(x2,y2,'Linewidth',2);
    legendText = legend([l1,l2],'Sp1','Sp2','FontSize', 18,'FontName','problem_E 2','location','northeast');
